Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
How does Chrome determine the input[type="date"] format?

My browser's navigator.language is en-US, system (macos) primary language is English (United States). When I do new Date().toLocaleDateString() in chrome console I got 10/27/2021 which is as expected. The weird thing is for a simple HTML <input type="date" value="2021-10-27" /> It shows up in my Chrome as 27/10/2021. I've searched up and down and couldn't figure out what caused Chrome to format date input this way. Any ideas?

chrome input date format for 2021-10-27

For comparison, in safari (navigator.language = "en-us") on the same computer, it shows up as 10/27/2021 as expected.

safari input date format for 2021-10-27

For quick reproduction, here's a code sandbox link which you can view in chrome & safari: https://codesandbox.io/s/youthful-moon-oiryd?file=/index.html:119-159

<input type="date" value="2021-10-27">

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Turned out it was because my macOS had its region set to Singapore, despite primary language set to English (US). After I updated the Region to be United States the date in the input changed to mm/dd/yyyy. I suppose this means Chrome picks up the system region for locale and it takes priority over the language settings. Funny that Chrome only does this for date input formatting but not for its implementation of toLocaleDateString – perhaps two different teams for DOM vs javascript implementation. Anyway, leaving this here in case it may help someone else.

macos language & regions setting

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!